from flask import Flask, jsonify, request

app = Flask(__name__)


@app.route('/api/hello', methods=['GET'])
def hello_world():
    name = request.args.get('name', 'World')  # 获取查询参数'name'，默认值为'World'
    print("name:" + name)
    return jsonify({'message': f'Hello, {name}!'})


if __name__ == '__main__':
    app.run(debug=True)
